﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
using System.Drawing;

public partial class DoctorScheduler : System.Web.UI.Page
{
    protected void Page_Init(object sender, EventArgs e)
    {


    }

    protected void Page_Load(object sender, EventArgs e)
    {
        //DoctorScheduler.VisibleRangeEnd 
    }

    protected void DoctorScheduler_DataBound(object sender, EventArgs e)
    {
        DoctorsScheduler.ResourceTypes.FindByName("Doctor").AllowMultipleValues = false;
        DoctorsScheduler.ResourceTypes.FindByName("Room").AllowMultipleValues = false;
    }
    protected void DoctorScheduler_AppointmentCreated(object sender, AppointmentCreatedEventArgs e)
    {

        if (e.Appointment.RecurrenceState == RecurrenceState.Master || e.Appointment.RecurrenceState == RecurrenceState.Occurrence)
        {
            Panel recurrenceStateDiv = new Panel();
            recurrenceStateDiv.CssClass = "rsAptRecurrence";
            e.Container.Controls.AddAt(0, recurrenceStateDiv);
        }
        if (e.Appointment.RecurrenceState == RecurrenceState.Exception)
        {
            Panel recurrenceStateDiv = new Panel();
            recurrenceStateDiv.CssClass = "rsAptRecurrenceException";
            e.Container.Controls.AddAt(0, recurrenceStateDiv);
        }
    }
    protected void DoctorsScheduler_AppointmentCreated(object sender, AppointmentCreatedEventArgs e)
    {
        if (e.Appointment.RecurrenceState == RecurrenceState.Master || e.Appointment.RecurrenceState == RecurrenceState.Occurrence)
        {
            Panel recurrenceStateDiv = new Panel();
            recurrenceStateDiv.CssClass = "rsAptRecurrence";
            e.Container.Controls.AddAt(0, recurrenceStateDiv);
        }
        if (e.Appointment.RecurrenceState == RecurrenceState.Exception)
        {
            Panel recurrenceStateDiv = new Panel();
            recurrenceStateDiv.CssClass = "rsAptRecurrenceException";
            e.Container.Controls.AddAt(0, recurrenceStateDiv);
        }
    }

    protected void DoctorsScheduler_AppointmentDataBound(object sender, SchedulerEventArgs e)
    {
        e.Appointment.ToolTip = string.Format("{0}:\n {1}\n{2}\n{3}", e.Appointment.Subject, e.Appointment.Resources[0].Text, e.Appointment.Resources[1].Text, e.Appointment.Resources[2].Text);
    }
}